package com.an.java.javaall;

public class FinallyTest {

    public static void main(String[] args) {
        System.out.println(getInt(0));
        System.out.println("------------------------");
        System.out.println(getInt(2));
    }

    public static int getInt(int i) {
        try {
            System.out.println("normal:" + i);

            return 44 / i;
        }catch (Exception e) {
            System.out.println("Exception:" + i);
            return -1;
        }finally {
            System.out.println("finally:" + i);
            //return -2;
        }
    }
}
